package com.bjboot.caocao.system.dao;

import com.bjboot.caocao.system.domain.UserRoleDO;

import java.util.List;

public interface UserRoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(UserRoleDO record);

    int insertSelective(UserRoleDO record);

    UserRoleDO selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(UserRoleDO record);

    int updateByPrimaryKey(UserRoleDO record);

    /**
     * 自定义方法，根据userId查询用户所有的角色Id
     * @param id
     * @return
     */
    List<Long> listRoleId(Long id);

    int batchRemove(Long[] ids);

    int removeByUserId(Long userId);

    int removeByRoleId(Long roleId);

    int batchSave(List<UserRoleDO> list);

    int batchRemoveByUserId(Long[] ids);
}